#ifndef __WAIT_FOR_CONNECT_H__
#define __WAIT_FOR_CONNECT_H__

#include "cocos2d.h"

USING_NS_CC;

#define ThreadLocker std::lock_guard<std::mutex>
#define sNotifer WaitForConnectLayer::GetInstance()

class WaitForConnectLayer : public Layer
{
public:
	WaitForConnectLayer();
	~WaitForConnectLayer();

	static WaitForConnectLayer* GetInstance();
	void ReLoadAllData(std::string _text = "");
	virtual bool init();
	virtual void update(float diff);
	void SetStringAndResetTime(std::string _string);
	void SetStringDisappearDelay(std::string _string, float time);
	void Show(std::string = "");
	void Disappear() { unscheduleUpdate(); setVisible(false); }
	CREATE_FUNC(WaitForConnectLayer);
private:
	Vec2 VisableSize;
	Sprite* Loading;
	Sprite* LoadingFrame;
	LabelTTF* Text;
	float ChangeImageTimer;
	float ConnectTotalTime;
	bool NeedToDisappear;
};



#endif